const AticleHttp = require("../../utils/articleHttp")
Page({
  data: {
    banner: [],
    autoplay: true,
    interval: 3000,
    duration: 1200,
  },
  onLoad: async function () {
    var res = await AticleHttp.getBanner()
    var banners = res.data.res
    this.setData({
      banners
    })
    var res = await AticleHttp.getAticle()
    var article = res.data.res
    console.log(article)
    this.setData({
      article
    })
  },
  handleClick(event) {
    console.log(event.currentTarget.dataset)
    var { aid } = event.currentTarget.dataset
    wx.navigateTo({
      url: `/pages/articleDetail/articleDetail?id=${aid}`
    })
  },
  
})